Aligns a string to the left of a string variable, or copies a variable of a user-defined type to another variable of a different user-defined type.
文字列変数の指定に従い文字列を左側に揃えるか、ユーザー定義型の変数を他のユーザー定義型の変数にコピーします。
LSet Var As String = Text or LSet Var1 = Var2
LSet Var As String = Text ないし LSet Var1 = Var2
Var: Any String variable that contains the string that you want align to the left.
Var: 文字列を左揃えにして格納する文字列変数。
Text: String that you want to align to the left of the string variable.
Text: 文字列変数中に左揃えで格納する文字列。
Var1: Name of the user-defined type variable that you want to copy to.
Var1: コピー先となるユーザー定義型の変数の名前。
Var2: Name of the user-defined type variable that you want to copy from.
Var2: コピー元となるユーザー定義型の変数の名前。
If the string is shorter than the string variable, LSet left-aligns the string within the string variable. Any remaining positions in the string variable are replaced by spaces. If the string is longer than the string variable, only the leftmost characters up to the length of the string variable are copied. With the LSet statement, you can also copy a user-defined type variable to another variable of the same type.
文字列が文字列変数よりも短い場合、LSet は、該当文字列だけを文字列変数中に左揃えで格納します。文字列変数の残りの部分は、スペース記号が挿入されます。文字列が文字列変数よりも長い場合、左側から文字列変数の長さの分だけがコピーされます。LSet ステートメントでは、ユーザー定義型の変数を、同じ型の他の変数にコピーすることもできます。
Sub ExampleRLSet
Sub ExampleRLSet
Dim sVar As String
Dim sVar As String
Dim sExpr As String
Dim sExpr As String
sVar = String(40,"*")
sVar = String(40,"*")
sExpr = "SBX"
sExpr = "SBX"
REM Align "SBX" within the 40-character reference string
REM "SBX"を40文字の参照文字列に配置をする
REM Replace asterisks with spaces
REM アスタリスク記号は、スペース記号で置き換えられます
RSet sVar = sExpr
RSet sVar = sExpr
Print ">"; sVar; "<"
Print ">"; sVar; "<"
sVar = String(5,"*")
sVar = String(5,"*")
sExpr = "123457896"
sExpr = "123457896"
RSet sVar = sExpr
RSet sVar = sExpr
Print ">"; sVar; "<"
Print ">"; sVar; "<"
sVar = String(40,"*")
sVar = String(40,"*")
sExpr = "SBX"
sExpr = "SBX"
REM Left-align "SBX" within the 40-character reference string
REM 40 文字長の文字列変数中に「SBX」を左揃えで格納します
LSet sVar = sExpr
LSet sVar = sExpr
Print ">"; sVar; "<"
Print ">"; sVar; "<"
sVar = String(5,"*")
sVar = String(5,"*")
sExpr = "123456789"
sExpr = "123456789"
LSet sVar = sExpr
LSet sVar = sExpr
Print ">"; sVar; "<"
Print ">"; sVar; "<"
End Sub
End Sub